You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a way to quickly open and edit a referenced document from ReferenceField and ReferencesField without navigating away from the parent doc.
Ensure modal edits are only persisted when the user explicitly clicks Save to avoid accidental DB writes while previewing or editing in the modal.
Description
Add a new context modal ReferenceFieldEditorModal with useReferenceFieldEditorModal() that embeds a DocEditor inside a DraftDocProvider configured for manual save, and a footer with Cancel and Save buttons.
Make modal use manual-save semantics by extending DraftDocController / DraftDocProvider with autoSave and flushOnStop flags and default behavior preserved when not overridden.
Wire quick-edit actions into ReferenceField and ReferencesField by adding a pencil Quick edit action icon that opens the new modal for the selected doc id.
Add hideStatusBar prop to DocEditor so the modal can render a compact editor UI without the full status bar.
Register ReferenceFieldEditorModal with the global ModalsProvider and add minimal modal footer CSS.
Testing
Attempted to run a TypeScript check via pnpm -C packages/root-cms exec tsc --noEmit --pretty false, but the environment failed to download pnpm via corepack due to network/proxy restrictions so the compile could not be completed.
Attempted a browser screenshot run with Playwright against http://127.0.0.1:3000, but no local app server responded so the check could not capture a running UI.
No visual or unit tests were added or executed as part of this change.
stevenle
changed the title
feat(cms): add ReferenceFieldEditorModal quick-edit modal for reference fields
feat: add quick edit modal for reference fields
Feb 25, 2026
@jeremydw this is ready for review when you have a sec. i debated back and forth about whether the default click on the reference card should open the modal or whether it should open a new tab, decided that the "quick edit icon" might be a clearer ux indicator but i'm happy to go either way on this one.
I think most other CMSes let you click it without a separate icon but I like the deliberateness of the icon so that SGTM. Wondering if we should stack the pencil and trash icons vertically though and center them to better occupy the space.
What do you think about putting the doc status badges, localization, history + publish button inside the modal? I envision scenarios where you want to do a quick edit and publish at the same time. At a minimum I think we should have a button or link to open up the full editor for the reference in a new tab.
re: vertical icons, i think the ux works a little better with the horizontal layout - with the vertical layout, the tooltips create weird states where if you hover over one with a tooltip, the tooltip blocks you from hovering over the other until you hover away. i think i can move the status badges to below the title though to help with the space issue (i swore i had already done this in another PR)
i personally don't want users to be able to do all of those things here since in the future we'll have things like publishing checks and other things which we don't want to handle from inside another doc. status badge is also already visible from the reference field preview card. i don't want the modal to be something that's left open indefinitely because it doesn't have the same collaborative editing style automatic updates as the main doceditor does. i can add an icon or button to open in a new tab though.
i played around with the ux a bit, here's what i liked best:
other options were adding a link to the doc id in the modal title, and having a more subtle action icon button with just a top-right arrow. both of those didn't seem as discoverable so i'm just liking having a small text button best.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ReferenceFieldandReferencesFieldwithout navigating away from the parent doc.Saveto avoid accidental DB writes while previewing or editing in the modal.Description
ReferenceFieldEditorModalwithuseReferenceFieldEditorModal()that embeds aDocEditorinside aDraftDocProviderconfigured for manual save, and a footer withCancelandSavebuttons.DraftDocController/DraftDocProviderwithautoSaveandflushOnStopflags and default behavior preserved when not overridden.ReferenceFieldandReferencesFieldby adding a pencilQuick editaction icon that opens the new modal for the selected doc id.hideStatusBarprop toDocEditorso the modal can render a compact editor UI without the full status bar.ReferenceFieldEditorModalwith the globalModalsProviderand add minimal modal footer CSS.Testing
pnpm -C packages/root-cms exec tsc --noEmit --pretty false, but the environment failed to downloadpnpmvia corepack due to network/proxy restrictions so the compile could not be completed.http://127.0.0.1:3000, but no local app server responded so the check could not capture a running UI.Codex Task
Fixes #930